<!-- 蓝色登录页面2 -->
<template>
	<view class="login-container">
		<common-head title="农户登录" 
		bg-color="#fff" titleStyle="#111" 
		autoBack iconColor="#111"></common-head>
		<view class="img-a">
			<image class="image-banner" src="@/static/login-banner.png"></image>
		</view>
		<view class="login-view" style="">
			<view class="t-login">
				<form class="cl">
					<view class="t-a">
						<text class="txt">承包方代表姓名</text>
						<input placeholder="请输入农经权证书中代表姓名" v-model="params.username" />
					</view>
					<view class="t-a">
						<text class="txt">身份证号码</text>
						<input maxlength="18" placeholder="请输入农经权证书中代表身份证号码" v-model="params.cbfsfzhm" />
					</view>
					<rh-submit-btn ref="submit-btn" text="登 录" @submit="submit"></rh-submit-btn>
					<!-- <button @tap="login()">登 录</button> -->
				</form>
			</view>
		</view>
	</view>
</template>
<script>
	import {login} from '@/script/api/common/login.js'
export default {
	data() {
		return {
			params: {
				cbfsfzhm: '342322197109060418', //承包方身份证号码，指承包方代表
				username: '陈立星' //承包方名称
			},
		};
	},
	onLoad() {},
	methods: {
		//当前登录按钮操作
		async submit() {
			let _self = this
			const {username, cbfsfzhm} = _self.params
			if(!username) {
				return _self.$attention.noIcon('姓名不能为空')
			}
			if(!cbfsfzhm) {
				return _self.$attention.noIcon('身份证号不能为空')
			}
			login(_self.params).then(res => {
				uni.setStorage({
					key: 'elybToken',
					data: `Bearer ${res.token}`,
					success: () => {
						uni.navigateTo({
							url: '/pages/appMain/list'
						});
					}
				})
			})
		},
	}
};
</script>
<style lang="scss" scoped>
.txt {
	font-size: 32rpx;
	font-weight: bold;
	color: #333333;
}
.img-a {
	width: 100%;
	height: 480rpx;
	.image-banner{
		width: 100%;
		
	}
}
.login-view {
	width: 100%;
	position: relative;
	margin-top: -120rpx;
	background-color: #ffffff;
	border-radius: 8% 8% 0% 0;
}

.t-login {
	width: 600rpx;
	margin: 0 auto;
	font-size: 28rpx;
	padding-top: 80rpx;
}

.t-login input {
	height: 90rpx;
	line-height: 90rpx;
	margin-bottom: 50rpx;
	border-bottom: 1px solid #e9e9e9;
	font-size: 28rpx;
}

.t-login .t-a {
	position: relative;
}


.t-login .uni-input-placeholder {
	color: #aeaeae;
}

.cl {
	zoom: 1;
}

.cl:after {
	clear: both;
	display: block;
	visibility: hidden;
	height: 0;
	content: '\20';
}
</style>
